﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Warehouse_Bar_Code
{
    public partial class 客户信息 : Form
    {
        public 客户信息()
        {
            InitializeComponent();
        }
        private void Customer_Load(object sender, EventArgs e)
        {
            //取消自动列
            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.DataSource = DBH.Select("select * from [Customer]");
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string name = textBox1.Text;
            string sql = $"select * from [Customer] where name like '%{name}%'";
            //取消自动列
            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.DataSource = DBH.Select(sql);
        }
    }
}
